home *** CD-ROM | disk | FTP | other *** search
- HELP.COM by Bob Montgomery 2/25/87
-
- This program is based on QHELP.ASM by Kurt Schelin, but was
- completely rewritten to make it a template for creating your own
- popup help screens. It contains all of the assembly code required to
- make your message pop up using your choice of a shift key combination
- for the hot keys; the shift keys are Cntrl, Alt, Left Shift, Right
- Shift, Caps Lock, Number Lock, and Scroll Lock. The code is written
- in A86 and MASM assembler formats, whichever you choose to use; I
- prefer A86 because it doesn't need the org, segment, assume, ends,
- etc assembler directives and is a little smarter. Border characters
- can be used to partition the help display, and to make it look more
- professional. The program automatically centers the help screen on
- the display, in the colors you selected with the Colattr equate.
-
- The help message can be any message you desire with the following
- restrictions:
- 1. The message must not exceed 80 characters/line-dictated by
- screen width.
- 2. The message cannot exceed 25 lines-dictated by the screen
- length.
- 3. Each line must be the same length-blank filled to make so.
-
- To make your own help screen, pick a combination of shift keys to be
- your hot keys and change the equate called Hotkey to the sum of these
- keys. In the template, the hot keys are Cntrl-Left Shift. Then,
- change the Colattr equate for the colors you want the help window to
- be; the first nibble is the background color (0-7), and the second
- nibble is the foreground color (0-15). If you want the help window to
- blink, add 8 to the background color. Then change the db statements
- at Hlpst and the following lines to your message; remember that each
- line must have the same number of characters. In the template, each
- line is a different upper case alphabetic letter. You may have from 1
- to 80 characters/line, and you may have from 1 to 25 lines for your
- help screen. The program will automatically center the help screen on
- the display; that's what the equates following the help message do.
- Then, assemble the source to the filename of your choice, and you
- have a help screen COM program. The help screen for VEdit Plus
- (VHELP.MSG) is included as an example, and can be substituted for the
- test screen between the equal sign borders.
-
- The program works with all displays (Monochrome, CGA, and EGA) in all
- 80 column text modes (will not work in graphics mode). It is a
- 'terminate and stay resident' program, and can be used with MARK &
- RELEASE to free up memory when it is no longer required. For
- instance, with QEdit, I do MARK, QHELP, QEDIT (filename), RELEASE in
- a batch file.
-
- The source is liberally commented so you can understand how it works.
- The first thing that happens when you call it is a jump to the
- initialize routine, which gets and saves the old keyboard interrupt
- (Int 9) and the vectors the keyboard interrupt to this program. Then,
- it terminates but stays resident, and the Start portion of the
- program handles all keyboard interrupts from this point on.
-
- A keyboard interrupt is generated each time a key is pressed or
- released, and the neccessary steps required to get the key are known
- only to the BIOS Int 9 routine. Therefore, we must call the BIOS Int
- 9 routine from this program to handle the key action. The only
- problem with this is that the BIOS Int 9 program is an interrupt
- handler and not a subroutine, which means it pops the return address
- (like a subroutine) and the flag register at completion. To fake it
- out and keep the stack pointer where it should be, we push the flags
- before calling the BIOS Int 9 routine (as a subroutine), and it pops
- the flags when it is done. The only thing the program looks for is
- the hot key combination on each keyboard interrupt, and it uses a
- BIOS service (Int 16-get shift status) to do this. Any other keys are
- ignored, but the action required to record the key press or release
- has been done by the call to the BIOS Int 9 routine in the new Int 9
- program. If the hot keys have been pressed, the program checks a
- flag to see if the help screen is already up; if so, the hot keys are
- ignored. This is done in the Start portion of the program.
-
- If the hot keys are pressed and the help screen is not up, the
- program then determines the current video mode and page, and saves
- it. From this, the current video display area of memory is
- determined. Then, the cursor is disabled and the help window area of
- the display is copied to a buffer in the program, so it can be
- restored when the help window is removed. The help window data is
- then copied to display memory with whatever attribute (color) you
- selected, and the display is then unblanked. A flag is set to
- indicate that the help window is up. Your help data is now visible on
- the display, and is centered horizontally and vertically, and in the
- color you selected with the Colattr equate (if you have a color
- display). To avoid 'snow' on CGA monitors while video memory is being
- accessed, the display is blanked during video read/write times, and
- blanking and unblanking occur at vertical retrace time; this is not
- done for the monochrome monitor, since it doesn't have the 'snow'
- problem.
-
- Now the program waits for the Escape key, and ignores all others.
- When the Escape key is finally pressed, video is disabled and the old
- screen data is put back on the display. Then the cursor is enabled
- and the display is unblanked, and you have your original screen back.
- The flag which indicates the help screen is up is cleared, and the
- program resumes looking for the hot keys.
-
- I hope this program is of some use to you, and you are free to copy
- and distribute it, but please distribute it in its original form so
- it can be used by others. I also hope you follow the source listing,
- and maybe learn something in the process. This is my contribution to
- the shareware community. Enjoy the program.
-
- If you have any comments or suggestions, I can be contacted at the
- Black Hole BBS in Orlando, Fl., 1200/2400 Baud (305) 260-6397.
-
- Bob Montgomey
-